#ifndef BLOCKEDDATABUFFER_H
#define BLOCKEDDATABUFFER_H

namespace Library
{

class PLIBEXP BlockedDataBuffer
{
	public:
					BlockedDataBuffer(uint32 blockSize = 1024);
					~BlockedDataBuffer();

		bool8		add(uint8 * data, uint32 length);
		bool8		get(uint8 ** data, uint32 * length);
		bool8		remove(uint32 length);

	protected:
		struct Block;

		bool8		addBlock();
		bool8		removeBlock();
		bool8		copyData(uint8 ** data, uint32 * length, Block * block);

	protected:
		uint32		m_blockSize;
		Block *		m_head;
		Block *		m_tail;

	// prohibited
	private:
//		BlockedDataBuffer();
		BlockedDataBuffer(BlockedDataBuffer &);
		BlockedDataBuffer & operator=(BlockedDataBuffer &);
};

}; // namespace Library

#endif
